#include "CommandRepReg.h"
#include "define.h"
#include "MessageBlockManager.h"
#include "stockdrv.h"
#include "StockDataManager.h"

CCommandRepReg::CCommandRepReg(void)
{
	m_pServerObject = NULL;
}

CCommandRepReg::~CCommandRepReg(void)
{
}

int CCommandRepReg::DoMessage( IPacketData* pMessage )
{
	ACE_Message_Block& mb = *(pMessage->GetPacketData());

	
	uint16 u2Command;
	App_MessageBlockManager::instance()->Read<_DEFAULT_>(mb, u2Command);
	int nCount = 0;
	App_MessageBlockManager::instance()->Read<_DEFAULT_>(mb, nCount);
	RCV_REPORT_STRUCTEx* pData = (RCV_REPORT_STRUCTEx*)(mb.rd_ptr());
	//OUR_DEBUG((LM_INFO, "[CCommandRepReg::DoMessage] Command ID:%d\n", u2Command));
	CStockDataManager* pDataManager = dynamic_cast<CStockDataManager*>(m_pServerObject->GetExDataManager());
	assert(pDataManager != NULL);
	pDataManager->GetMinKLine()->PutNewReport(pData, nCount);
	return 0;
}
